<?

switch($act){

	case "detail":

	Detail();

	$tpl="detail";

	break;

	

	case "map":

	Detail();

	$tpl="map";

	break;



	default:

	Detail();

	$tpl="detail";

	break;

}

function Detail()
{
	global $db, $intro_comp,$title_bar, $img_intro, $idMenuMain, $arrIntro, $anotherIntro, $cat, $lg, $title_page;

	if(isset($_GET['cat1'])){
		
		global $cat1;
		$cat = $cat1;
		
		if(isset($_GET['cat2'])){
			global $cat2;
			$cat = $cat2;
		}
		
		$id = $cat['id'];

		$title_bar = $cat["name_$lg"];

		
		$sql = "select name_vn, name_en, short_vn, short_en, content_vn, content_en, img from intro where id=$id";

		$arr = $db->getRow($sql);

		$intro_comp = $arr["content_$lg"];

	}else{

		$id=CleanSQLInjection(trim(isset($_GET['cid'])?$_GET['cid']:''));
	

		$title_bar =  getTitleBar($id, 1, '');

		$sql = "select name_vn, name_en, short_vn, short_en, content_vn, content_en, img from intro where id=$id";

		$arr = $db->getRow($sql);

		$arrIntro = $arr;

		$intro_comp = $arr["content_".$_SESSION['lg']];

		$img_intro = $arr['img'];
	}
}

?>